﻿@model IEnumerable<ITProject.WebUI.Models.Project.ProjectReleaseViewModel>

@{
    ViewBag.Title = "Wersje Projektu " + @Html.Encode(ViewData["ProjectName"]);
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Wersje projektu @Html.Encode(ViewData["ProjectName"])</h2>



<div class="Pmenu">
@Html.Partial(MVC.Shared.Views.Partials._ProjectMenuControl, 
        new ITProject.WebUI.Models.Project.ProjectMenuViewModel { ProjectName = (string)ViewData["ProjectName"], Role = (ITProject.Domain.UserRole)ViewData["Role"] })
</div>
<div class="PAplane">

<div>
        <span style="width:150px" class="callTH">
            Nazwa 
        </span>
        <span style="width:206px" class="callTH">
            Opis
        </span>
        <span  style="width:200px" class="callTH">Planowana data zakonczenia</span>
        <span style="width:100px" class="callTH">Status</span>
</div>
<div>
    @{
    int i = 0;
}
@foreach (var item in Model)
{
         i++;
     
        <span style="width:150px"  class="call">
            @Html.DisplayFor(modelItem => item.Name)
        </span>
        <span style="width:206px" class="call">
            @Html.DisplayFor(modelItem => item.Description)
        </span>
        <span style="width:200px" class="call">
            @Html.DisplayFor(modelItem => item.PlannedEndDate)
        </span>
        <span style="width:100px" class="call">
            @Html.DisplayFor(modelItem => item.ReleaseStatus)
        </span><br />
            <span id="@i.ToString()" style="width:650px" class="showUser" >Historia zmian
        </span><br />
     
                 string id = i.ToString() + "U";
 
    <div id="@id.ToString()" style="display:none" class="userss">
    @if (item.ReleaseStatusChange.Length == 0)
    {
        <span  class="listU">brak</span>
    }
    else
    {
        <span class="callTH" style="width:150px">Data zmiany</span>
        <span class="callTH" style="width:100px">Stary Status</span>
        <span class="callTH" style="width:100px">Nowy Status</span>
        <span class="callTH" style="width:190px">Komentarz</span>
        <span class="callTH" style="width:90px">Przez</span><br />
    }

    @foreach (ITProject.WebUI.Models.Project.StatusChangeViewModel items in item.ReleaseStatusChange)
    {

        <span class="listU" style="width:150px">
        @Html.DisplayFor(model=>items.DateOfChange)
        </span>
        
        <span class="listU" style="width:100px">
        @Html.DisplayFor(model => items.OldStatus)
        </span>
        
        <span class="listU" style="width:100px">
        @Html.DisplayFor(model => items.NewStatus)
        </span>
        
        <span class="listU" style="width:190px">
        @Html.DisplayFor(model => items.Comment)
        </span>
        <span class="listU" style="width:90px">
        @Html.DisplayFor(model => items.User)
        </span>
       
    } 
    </div>
}

</div>
</div>
<div class="clear"></div>